package cn.gok.test;

import cn.gok.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
    测试生命周期
 */

public class SpringTest04 {
    public static void main(String[] args) throws InterruptedException {
        ApplicationContext app  = new ClassPathXmlApplicationContext("application01.xml");
        User user = app.getBean("user", User.class);
        System.out.println(user);


        //关闭容器
        ((ClassPathXmlApplicationContext)app).close();


        Thread.sleep(1000);

    }
}
